package com.itheima.exception;

public class Demo04 {

    public static void main(String[] args) {

        int[] arr={11,22,33,44,55};

        try {
            System.out.println("A");
            System.out.println(arr[8]);//new ArrayIndexOutOfBoundsException()
            System.out.println("B");
        }catch (NullPointerException e) {
            System.out.println("C");
            System.out.println("芽儿哟,出错了");
        }catch (ArrayIndexOutOfBoundsException e) {
            System.out.println("D");
            System.out.println("芽儿哟,出错了");
        } catch (Exception e){// Exception e= new ArrayIndexOutOfBoundsException();

        }


    }
}
